import { request } from '@/utils/request.js'

export default {
    /**
     * 获取列表
     * @returns
     */
    getBannerPageList (params = {}) {
        return request({
            url: 'mini/life/bannerList',
            method: 'get',
            params
        })
    },


    /**
     * 添加
     * @returns
     */
    bannerSave (data = {}) {
        return request({
            url: 'mini/life/bannerSave',
            method: 'post',
            data
        })
    },

    /**
     * 删除
     * @returns
     */
    bannerDeletes (data) {
        return request({
            url: 'mini/life/bannerDelete',
            method: 'delete',
            data
        })
    },

    /**
     * 更新数据
     * @returns
     */
    bannerUpdate (id, params = {}) {
        return request({
            url: 'mini/life/bannerUpdate/' + id,
            method: 'put',
            data: params
        })
    },

    /**
     * 更改状态
     * @returns
     */
    bannerUpdateByKeys(data = {}) {
        return request({
            url: 'mini/life/bannerUpdateByKeys',
            method: 'put',
            data
        })
    },

    moduleUpdate (id, params = {}) {
        return request({
            url: 'mini/life/moduleUpdate/' + id,
            method: 'post',
            data: params
        })
    },

    getModuleItemPageList (params = {}) {
        return request({
            url: 'mini/life/moduleItemList',
            method: 'get',
            params
        })
    },


    /**
     * 添加
     * @returns
     */
    moduleItemSave (data = {}) {
        return request({
            url: 'mini/life/moduleItemSave',
            method: 'post',
            data
        })
    },

    /**
     * 删除
     * @returns
     */
    moduleItemDeletes (data) {
        return request({
            url: 'mini/life/moduleItemDelete',
            method: 'delete',
            data
        })
    },

    /**
     * 更新数据
     * @returns
     */
    moduleItemUpdate (id, params = {}) {
        return request({
            url: 'mini/life/moduleItemUpdate/' + id,
            method: 'put',
            data: params
        })
    },

    /**
     * 更改状态
     * @returns
     */
    moduleItemUpdateByKeys(data = {}) {
        return request({
            url: 'mini/life/moduleItemUpdateByKeys',
            method: 'put',
            data
        })
    },


    //list item
    getListMain(params = {}){
        return request({
            url: 'mini/life/getListMain',
            method: 'get',
            params
        })
    },
    listMainSave(pid,data = {}){
        return request({
            url: 'mini/life/listMainSave/'+pid,
            method: 'post',
            data
        })
    },
    getListDetailPageList(params = {}){
        return request({
            url: 'mini/life/getListDetailPageList',
            method: 'get',
            params
        })
    },
    listDetailSave(data = {}){
        return request({
            url: 'mini/life/listDetailSave',
            method: 'post',
            data
        })
    },
    listDetailDeletes(data = {}){
        return request({
            url: 'mini/life/listDetailDeletes',
            method: 'delete',
            data
        })
    },

    listDetailUpdate(id,params = {}){
        return request({
            url: 'mini/life/listDetailUpdate/'+id,
            method: 'put',
            data: params
        })
    },
    listDetailUpdateByKeys(data = {}){
        return request({
            url: 'mini/life/listDetailUpdateByKeys',
            method: 'put',
            data
        })
    },
}
